package com.linkgie.galaxyframework.templating.model.maven;

import java.util.LinkedList;
import java.util.List;

import com.linkgie.galaxyframework.templating.model.java.JavaPackage;
import com.linkgie.galaxyframework.templating.model.java.JavaSourceCode;

/**
 * Maven 项目的 java 源码；
 * 
 * @author huanghaiquan
 *
 */
public class MavenJavaSource {
	
	public static final String DEFAULT_DIRECTORY = "src/main/java";
	
	/**
	 * Java 源码目录；<p>
	 * 
	 * 通常是 src/main/java ；
	 */
	private String directory = DEFAULT_DIRECTORY;
	
	
	private JavaPackage basePackage;

	/**
	 * Java 源码文件清单；
	 */
	private List<JavaSourceCode> javaSources = new LinkedList<>();

	public String getDirectory() {
		return directory;
	}

	public void setDirectory(String directory) {
		this.directory = directory;
	}

	public List<JavaSourceCode> getJavaSources() {
		return javaSources;
	}

	public void setJavaSources(List<JavaSourceCode> javaSources) {
		this.javaSources = new LinkedList<>(javaSources);
	}
	
	public void addJavaSources(List<JavaSourceCode> javaSources) {
		this.javaSources.addAll(javaSources);
	}
	
	
	public void addJavaSources(JavaSourceCode... javaSources) {
		for (JavaSourceCode javaSourceCode : javaSources) {
			this.javaSources.add(javaSourceCode);
		}
	}

	public JavaPackage getBasePackage() {
		return basePackage;
	}

	public void setBasePackage(JavaPackage rootPackage) {
		this.basePackage = rootPackage;
	}
	
}
